// $Id$
package de.servicezombie.cxf;

/**
 * AbstractFactory. Using a factory here is usefull for tests. This way we are able 
 * to exchange the template instance in unit tests.
 * 
 * To get the cxf aware default instance, just use this snippet:
 * <code>ShopWebserviceTemplate t = new WebserviceTemplateFactory.build()</code>
 */
public abstract class AbstractWebserviceTemplateFactory {

	private WebserviceTemplateProvider provider;

	protected AbstractWebserviceTemplateFactory(WebserviceTemplateProvider provider) {
		super();
		this.provider = provider;
	}

	protected final WebserviceTemplateProvider getProvider() {
		return provider;
	}

	public WebserviceTemplate build() {
		return getProvider().getWebserviceTemplate();
	}

}
